package com.feiyi.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feiyi.app.R;
import com.feiyi.app.bean.GoodsDetailBean;
import com.feiyi.app.bean.HomePageBean;
import com.feiyi.app.glideutils.GlideImgManager;
import com.feiyi.app.utils.ImageUtil;

import java.util.List;

/**
 * 作者 : wlt
 * 创建时间:  2018-07-15
 * QQ : 1346947404
 * 邮箱:wanglt_android@163.com
 * 类说明:商品详情推荐的数据列表适配器
 * In me the tiger sniffs the rose
 */

public class DetailRecommendGoodsAdapter extends BaseQuickAdapter<GoodsDetailBean.DataBean.RecommendGoodsBean,BaseViewHolder> {

    private ImageView iv_goods;

    public DetailRecommendGoodsAdapter(int layoutResId, @Nullable List<GoodsDetailBean.DataBean.RecommendGoodsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsDetailBean.DataBean.RecommendGoodsBean item) {

        iv_goods = helper.getView(R.id.iv_goods_pic);
        ImageUtil.suitDisplay(iv_goods,1,1,4,1);
        GlideImgManager.loadImage(mContext,item.getImg().getThumb(),iv_goods);
        helper.setText(R.id.item_name,item.getName()).
                setText(R.id.tv_home_price,item.getShop_price()).
                setText(R.id.tv_home_goods_focus,"关注:"+item.getClick_count());

    }

}
